package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.HhOrderMapper;
import com.ruoyi.system.domain.HhOrder;
import com.ruoyi.system.service.IHhOrderService;

/**
 * 销售订单Service业务层处理
 * 
 * @author ruoyi
 * @date 2021-06-15
 */
@Service
public class HhOrderServiceImpl implements IHhOrderService 
{
    @Autowired
    private HhOrderMapper hhOrderMapper;

    /**
     * 查询销售订单
     * 
     * @param orderId 销售订单ID
     * @return 销售订单
     */
    @Override
    public HhOrder selectHhOrderById(String orderId)
    {
        return hhOrderMapper.selectHhOrderById(orderId);
    }

    /**
     * 查询销售订单列表
     * 
     * @param hhOrder 销售订单
     * @return 销售订单
     */
    @Override
    public List<HhOrder> selectHhOrderList(HhOrder hhOrder)
    {
        return hhOrderMapper.selectHhOrderList(hhOrder);
    }

    /**
     * 新增销售订单
     * 
     * @param hhOrder 销售订单
     * @return 结果
     */
    @Override
    public int insertHhOrder(HhOrder hhOrder)
    {
        hhOrder.setCreateTime(DateUtils.getNowDate());
        return hhOrderMapper.insertHhOrder(hhOrder);
    }

    /**
     * 修改销售订单
     * 
     * @param hhOrder 销售订单
     * @return 结果
     */
    @Override
    public int updateHhOrder(HhOrder hhOrder)
    {
        hhOrder.setUpdateTime(DateUtils.getNowDate());
        return hhOrderMapper.updateHhOrder(hhOrder);
    }

    /**
     * 批量删除销售订单
     * 
     * @param orderIds 需要删除的销售订单ID
     * @return 结果
     */
    @Override
    public int deleteHhOrderByIds(String[] orderIds)
    {
        return hhOrderMapper.deleteHhOrderByIds(orderIds);
    }

    /**
     * 删除销售订单信息
     * 
     * @param orderId 销售订单ID
     * @return 结果
     */
    @Override
    public int deleteHhOrderById(String orderId)
    {
        return hhOrderMapper.deleteHhOrderById(orderId);
    }
}
